package com.atguigu.gmall.feign.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderInfo;
import com.atguigu.gmall.model.vo.order.OrderConfirmVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("service-order")
@RequestMapping("/rpc/inner/order")
public interface OrderFeign {

    @GetMapping("/orderList")
    Result<OrderConfirmVo> orderList();

    @GetMapping("/infoByOrderId")
    Result<OrderInfo> infoById(@RequestParam("orderId") Long orderId);

    @GetMapping("/updateOrderStatusToPaid/{outTradeNo}")
    Result updateOrderStatusToPaid(@PathVariable("outTradeNo") String outTradeNo);

    @GetMapping("/checkOrderStatusByAliPay/{outTradeNo}")
    Result checkOrderStatusByAliPay(@PathVariable("outTradeNo") String outTradeNo);
}
